# -*- coding: utf-8 -*-
"""
BLL层 系统相关模块.
"""

import DAL.Gallery
import DAL.GoodsType
import DAL.FileUp

def _api_get_api_goodsType_html():
    """
    """
    html = """
<html>
	<head>
		<title>API接口帮助文档</title>
	</head>

	<body>
    """
    dal_goodsType = dir(DAL.GoodsType)
    for def_goodsType in dal_goodsType:
        if def_goodsType[1:4] == "api":
            html += """
    <hr>
    <h1>""" + def_goodsType + """<h1>"""
            try:
                html += """
                    <h3>""" + eval("DAL.GoodsType." + def_goodsType).__doc__.replace('\n', '<br>') + """<h3>
                    """
            except:
                continue



    html += """
	</body>
</html>
    """

    return html

def _api_get_api_gallery_html():
    """
    API接口帮助--返回API接口说明--HTML.

    :return:
    """
    html = """
<html>
	<head>
		<title>API接口帮助文档</title>
	</head>

	<body>
    """


    dal_gallery = dir(DAL.Gallery)
    for def_gallery in dal_gallery:
        if def_gallery[1:4] == "api":
            html += """
        <hr>
        <h1>""" + def_gallery + """<h1>"""
            try:
                html += """
                        <h3>""" + eval("DAL.Gallery." + def_gallery).__doc__.replace('\n', '<br>') + """<h3>
                        """
            except:
                continue


    html += """
	</body>
</html>
    """

    # print html
    return html

def _api_get_api_fileup_html():
    """
    """
    html = """
<html>
	<head>
		<title>API接口帮助文档</title>
	</head>

	<body>
    """
    dal_fileUp = dir(DAL.FileUp)
    for def_fileUp in dal_fileUp:
        if def_fileUp[1:4] == "api":
            html += """
    <hr>
    <h1>""" + def_fileUp + """<h1>"""
            try:
                html += """
                    <h3>""" + eval("DAL.FileUp." + def_fileUp).__doc__.replace('\n', '<br>') + """<h3>
                    """
            except:
                continue



    html += """
	</body>
</html>
    """

    return html